package com.fh.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.utils.bean.Customer;
import com.utils.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
* @author Administrator
* @description 针对表【customer】的数据库操作Mapper
* @createDate 2023-05-10 10:40:28
* @Entity com.fh.bean.Customer
*/
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {

    /**
     * @description:分页查询
     * @author whf
     * @date 2023/5/17 10:27
     * @param page
     * @param id
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.utils.bean.Customer>
     */
    @Select("select c.* from customer c inner join `user` u " +
            "on c.user_id = u.id where u.id = #{id}")
    IPage<Customer> getCustomer(@Param("page") Page<Customer> page, @Param("id") Long id);


    /**
     * @description: 根绝名字 手机号 性别之类的查询
     * @author whf
     * @date 2023/5/17 10:27
     * @param customer
     * @return java.util.List<com.utils.bean.Customer>
     */
    List<Customer> getCustomerIF(@Param("customer") Customer customer);

    /**
     * @description: 查询BOSS可以看到的信息
     * @author whf
     * @date 2023/5/17 14:38
     * @param page
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.utils.bean.User>
     */
    IPage<Customer> getBoss(@Param("page") Page<Customer> page);

}
